﻿using System;

namespace Vbyte.SharpOrm.Config
{
    /// <summary>
    /// 字段描述
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class , Inherited = true, AllowMultiple = false)]
    public class CommentAttribute : Attribute
    {
        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>The description.</value>
        public string Description { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CommentAttribute"/> class.
        /// </summary>
        /// <param name="description">The description.</param>
        public CommentAttribute(string description)
        {
            Description = description;
        }
    }

    /// <summary>
    /// 字段数据类型配置
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
    public class SqlDbTypeAttribute : Attribute
    {
        /// <summary>
        /// 原生精简数据类型定义
        /// </summary>
        public string NativeTypeDefine { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CommentAttribute"/> class.
        /// </summary>
        /// <param name="nativeType">精简数据类型定义</param>
        public SqlDbTypeAttribute(string nativeType)
        {
            NativeTypeDefine = nativeType;
        }
    }
}